Ext.define('js.foundation.FoundationAYShowPage', {
    extend: 'Ext.grid.Panel',
    requires: ['js.Util', 'js.ctrl.Common',],
    controller: 'Common',
    autoScroll : true,
    id:'FoundationAYShowPage',
    margin:'30 15 30 15',
    height:'100%',
    height:508,
    bodyStyle: {
        backgroundColor: '#eee',
    },
    initComponent: function () {
        this.store = Ext.create('js.store.foundation.RfoundationSystemStore');
        this.store.getProxy().setExtraParam('pageNum', 1);
        this.store.getProxy().setExtraParam('progress_type',this.status);
        this.store.getProxy().setExtraParam('engineering_id',this.engineering_id);
        this.store.load({
            callback:function () {
                let me = Ext.getCmp('ztFoundationAShowPage');
                if(me){
                    if(me.store.data.items.length>0){
                        new Page({
                            id: 'paginationSupplierAbcA',
                            pageTotal: me.store.data.items[0].data.pageTotal, //必填,总页数
                            pageAmount: 10,  //每页多少条
                            dataTotal: me.store.data.items[0].data.dataTotal, //总共多少条数据
                            curPage:parseInt(me.store.data.items[0].data.pageNum), //初始页码,不填默认为1
                            pageSize: 5, //分页个数,不填默认为5
                            showPageTotalFlag:true, //是否显示数据统计,不填默认不显示
                            showSkipInputFlag:true, //是否支持跳转,不填默认不显示
                            getPage: function (page) {
                                //获取当前页数
                                me.store.getProxy().setExtraParam('pageNum', page);
                                me.store.reload();
                            }
                        })
                    }else{
                        new Page({
                            id: 'paginationSupplierAbcA',
                            pageTotal: 1, //必填,总页数
                            pageAmount: 10,  //每页多少条
                            dataTotal: 0, //总共多少条数据
                            pageSize: 5, //分页个数,不填默认为5
                            showPageTotalFlag:true, //是否显示数据统计,不填默认不显示
                            showSkipInputFlag:true, //是否支持跳转,不填默认不显示
                            getPage: function (page) {
                                //获取当前页数
                                me.store.getProxy().setExtraParam('pageNum', page);
                                me.store.reload();
                            }
                        })
                    }
                }
            }
        });
        this.columns = [
            {text: '序号', dataIndex: 'progress_no', align: 'center', flex: 2,
                renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {//自定义列值组合
                    if(this.Zstsatus==1){
                        return `<div class="mutualA"><a herf="#">${value}</a></div>`;
                    }else{
                        return `<div class="mutualA"><a herf="#" style="color:red">${value}</a></div>`;
                    }
                }},
            {text: '监督日期', dataIndex: 'supervision_date', align: 'center', flex: 1,},
            {text: '监督人员', dataIndex: 'reporter_name', align: 'center', flex: 1,},
            {text: '报验日期', dataIndex: 'inspection_date', align: 'center', flex: 1,},
            {text: '报验资料名', dataIndex: 'inspection', align: 'center', flex: 2,},
            {text: '报验人及电话', dataIndex: 'user_information', align: 'center', flex: 2,},
            {text: '是否下发</br>整改', dataIndex: 'inspection_result_text', align: 'center', flex: 1,},
            {
                text: "操作", dataIndex: 'user_id',
                flex:2,
                align: 'center',
                renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {//自定义列值组合
                    return '<span style="margin-right:20px;color:#2672d9;font-size: 17px;letter-spacing: 1px;cursor:pointer;"><a href="#" style="text-decoration:none;" onclick="xiangqinggcjdysjd(' + JSON.stringify(record.data).replace(/\"/g, "'") + ')">详情</a></span> <span style="margin-right:20px;color:#ff8041;font-size: 17px;letter-spacing: 1px;cursor:pointer;"> <a href="#" style="text-decoration:none;" onclick="updgcjdysjdA(' + JSON.stringify(record.data).replace(/\"/g, "'") + ')">编辑</a></span><span style="margin-right:20px;color:#ff8041;font-size: 17px;letter-spacing: 1px;cursor:pointer;"><a a  href="#" style="text-decoration:none;" onclick="delgcjdysjdA(' + JSON.stringify(record.data).replace(/\"/g, "'") + ')">删除</a> </span>';
                },height:44
            }
        ];
        this.dockedItems = [
            {
                xtype: 'panel',
                html: '<div id="paginationSupplierAbcA" class="pagination"></div>',
                dock: 'bottom',
                height: 50,
                margin: '-14 0 0 0',
                displayInfo: true,
            }];
        this.callParent(arguments);
    }
});